package com.itheima.thread.create.demo03;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class ThreadDemo01 {

    public static void main(String[] args) throws ExecutionException, InterruptedException {

        MyCallable myCallable = new MyCallable();

        FutureTask futureTask = new FutureTask(myCallable);

        Thread thread = new Thread(futureTask);

        thread.start();

        Integer result =(Integer) futureTask.get();
        System.out.println(result);

    }

}
